package cn.wolfcode.trip.base.service.impl;


import cn.wolfcode.trip.base.domain.Ticket;
import cn.wolfcode.trip.base.mapper.TicketMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.ITicketService;
import cn.wolfcode.trip.base.service.ITicketService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class TicketServiceImpl implements ITicketService {
    @Autowired
    private TicketMapper ticketMapper;




    @Override
    public PageInfo query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize(), qo.getOrderBy());
        List<Ticket> list = ticketMapper.queryForList(qo);
        return new PageInfo(list);
    }

    public void updateState(Ticket entity) {

            ticketMapper.updateState(entity);

    }

    public List queryAllByState(Ticket entity) {
        return ticketMapper.selectAllByState(entity);
    }


}
